package controller.activiti;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.activiti.engine.RepositoryService;
import org.activiti.engine.RuntimeService;
import org.activiti.engine.TaskService;
import org.activiti.engine.runtime.ProcessInstance;
import org.activiti.engine.task.Task;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * 使用spring启动activiti TODO
 * 
 * @author hxl 2018年12月29日
 */
@Controller()
public class ActivitiController {
	/*
	 * @Autowired private RuntimeService runtimeService;
	 * 
	 * @Autowired private RepositoryService repositoryService;
	 * 
	 * @Autowired private TaskService taskService;
	 * 
	 * @RequestMapping("springactiviti") public void getActiviti(){
	 * repositoryService.createDeployment()
	 * .addClasspathResource("activitiBMPNXML/myProcess.bpmn20.xml") .deploy();
	 * ProcessInstance processInstance =
	 * runtimeService.startProcessInstanceByKey("financialReport");
	 * System.out.println(processInstance.getActivityId()); List<Task> tasks =
	 * taskService.createTaskQuery().taskCandidateGroup("accountancy").list();
	 * Map<String, Object> variables = new HashMap<String, Object>();
	 * variables.put("employeeName", "hxl"); variables.put("numberOfDays", new
	 * Integer(1)); variables.put("vacationMotivation", "ceshi");
	 * runtimeService.startProcessInstanceByKey("vacationRequest",variables); }
	 */
}
